package com.test.shiro.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/test")
    public String test(){
        return "test";
    }

    @RequiresPermissions("user:del")
    @GetMapping("/del")
    @ResponseBody
    public String del(){
        System.out.println("删除成功");
        return "删除成功";
    }


    @RequiresPermissions("user:add")
    @RequestMapping("/add")
    public String add(){
        return "删除成功";
    }


    @RequiresPermissions("user:edit")
    @RequestMapping("/edit")
    public String edit(){
        return "修改成功";
    }


    @RequiresPermissions("user:sel")
    @RequestMapping("/sel")
    public String sel(){
        return "查看成功";
    }
}
